﻿@{
    Layout = null;
    ViewBag.Title = "管理收货地址";
    var list = ViewData["list"] as List<Pay.DTO.shippingaddress_dto>;
}
<html>

<head>
    <meta charset="UTF-8">
    <title>选择收货地址</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telphone=no, email=no" />
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <link href="~/Content/css/reset.css" rel="stylesheet" />
    <link href="~/Content/css/swiper.min.css" rel="stylesheet" />
    <link href="~/Content/css/gelunbu.css" rel="stylesheet" />
    <script src="~/Content/js/jquery-3.2.1.min.js"></script>
    <script src="~/Content/js/layer/1.9.3/layer.js"></script>
    <script src="~/Content/js/web.js"></script>
    <script type="text/javascript">
        function jump(id) {
            ajax({
                url: '/user/UpdateAddress',
                data: { address_id: id },
                success_msg: "更换成功",
                fail_msg: "更换失败",
                actions: 'redirect',
                redirect: document.referrer
            });
        }
    </script>
</head>

<body style="background: #f0f0f0;">
   
    <div class="select_addr">
        @if (list != null && list.Count > 0) {
            foreach (var item in list) {
                <div class="select_addr_list" onclick="jump('@item.id')">
                    <div class="selet_name">
                        收货人：  @item.shipto <span class="phone">@item.phone</span>
                    </div>
                    <p class="select_addr_detail">地址：@(item.region.region_name + " " + item.address)</p>
                    <div class="sf_num">
                        <i class="icon_sf"></i>@item.id_card
                    </div>
                </div>
            }
        }

        <a href="/User/AdressList" class="finish_btn">管理收货地址</a>

    </div>
</body>
</html>